DISCUSSION
You can register your callback function by calling the function
ATSUCreateMemorySetting and passing the constant
kATSUUseCallbacks in
iHeapSpec and a pointer to the
ATSUMemoryCallbacks union in
iMemoryCallbacks. You then supply a pointer of type
ATSUCustomAllocFunc in the
Alloc field of the
callbacks structure of the
ATSUMemoryCallbacks union.
Note that your
MyATSUCustomAllocFunc function is expected to return a pointer to the start of the allocated memory, unless it terminates in an application.